
#ifndef  _SEMAPHORE__
#define  _SEMAPHORE_

#include <stdio.h>
#include <string.h>
#include <errno.h>

#include <sys/types.h>
#include <sys/ipc.h>

#include <sys/types.h>
#include <unistd.h>

#include <stdlib.h>

#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/sem.h>

#define FTOK_PATH     "/dev/zero"
#define FTOK_PROJID   0x22
union semun
{
	int    val;
	struct semid_ds  *buf;
	unsigned short   *array;

};
int semaphore_init(void);
int semaphore_p(int semid);
int semaphore_v(int semid);
void semaphore_term(int semid);

#endif
